home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** Header containing the information needed to parse Sun's .au files.
- **
- ** by Mark Cookson, Apple Developer Technical Support
- **
- ** File: ULAW.h
- **
- ** Copyright ©1996 Apple Computer, Inc.
- ** All rights reserved.
- **
- ** You may incorporate this sample code into your applications without
- ** restriction, though the sample code has been provided "AS IS" and the
- ** responsibility for its operation is 100% yours. However, what you are
- ** not permitted to do is to redistribute the source as "Apple Sample
- ** Code" after having made changes. If you're going to re-distribute the
- ** source, we require that you make it clear in the source that the code
- ** was descended from Apple Sample Code, but that you've made changes.
- */
-
- #ifndef __ULAW__
- #define __ULAW__
-
- #include <Errors.h>
- #include <SoundComponents.h>
- #include <Types.h>
-
- #ifndef __DBFFERRORS__
- #include "DBFF_Errors.h"
- #endif
-
- #ifndef __SETUPDBHEADER__
- #include "SetupDBHeader.h"
- #endif
-
- #ifndef __LDANDFIX__
- #include "LDandFix.h"
- #endif
-
- #ifndef __DEFINES__
- #include "Defines.h"
- #endif
-
- /* data format possibilities */
- #define SND_FORMAT_UNSPECIFIED 0 /* unspecified format (can't support this) */
- #define SND_FORMAT_MULAW_8 1 /* 8-bit mu-law samples */
- #define SND_FORMAT_LINEAR_8 2 /* 8-bit linear samples */
- #define SND_FORMAT_LINEAR_16 3 /* 16-bit linear samples */
- #define SND_FORMAT_LINEAR_24 4 /* 24-bit linear samples (can't support this) */
- #define SND_FORMAT_LINEAR_32 5 /* 32-bit linear samples (can't support this) */
- #define SND_FORMAT_FLOAT 6 /* floating-point samples (can't support this) */
- #define SND_FORMAT_DOUBLE 7 /* double-precision float samples (can't support this) */
- #define SND_FORMAT_INDIRECT 8 /* fragmented sampled data (can't support this) */
- #define SND_FORMAT_NESTED 9 /* ? (can't support this) */
- #define SND_FORMAT_DSP_CORE 10 /* DSP program (can't support this) */
- #define SND_FORMAT_DSP_DATA_8 11 /* 8-bit fixed-point samples (can't support this) */
- #define SND_FORMAT_DSP_DATA_16 12 /* 16-bit fixed-point samples (can't support this) */
- #define SND_FORMAT_DSP_DATA_24 13 /* 24-bit fixed-point samples (can't support this) */
- #define SND_FORMAT_DSP_DATA_32 14 /* 32-bit fixed-point samples (can't support this) */
- #define SND_FORMAT_DISPLAY 16 /* non-audio display data (can't support this, it isn't playable data anyway) */
- #define SND_FORMAT_MULAW_SQUELCH 17 /* ? (can't support this) */
- #define SND_FORMAT_EMPHASIZED 18 /* 16-bit linear with emphasis (can't support this) */
- #define SND_FORMAT_COMPRESSED 19 /* 16-bit linear with compression (can't support this) */
- #define SND_FORMAT_COMPRESSED_EMPHASIZED 20 /* A combination of the two above (can't support this) */
- #define SND_FORMAT_DSP_COMMANDS 21 /* Music Kit DSP commands (can't support this) */
- #define SND_FORMAT_DSP_COMMANDS_SAMPLES 22 /* ? (can't support this) */
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- typedef struct auHeader {
- unsigned long id; /* Should be '.snd' */
- unsigned long offsetToData; /* Offset into the file to where the data is */
- unsigned long dataSize; /* Length of data */
- unsigned long dataFormat; /* data format code */
- unsigned long sampleRate; /* Samples per second */
- unsigned long numChannels; /* 1 mono, 2 stereo */
- unsigned char info[4]; /* optional text info */
- }auHeader;
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- OSErr ASoundGetULAWHeader (SoundInfoPtr theSoundInfo,
- long *dataStart,
- long *length);
-
- #define kULAWHeaderBufferSize 24
-
- #endif
-